import axios from '@/api/fetch';
// import * as types from './types';
import SERVER from '@/api/server';

// 获取车型集合
export const getGraphicModelList = params =>
  axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicInfo/getGraphicModelList`, {
    params
  });

// 获取系统集合
export const getGraphicSystemList = params =>
    axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicInfo/getGraphicSystemList`, {
      params
    });
//获取一级代码集合
export const getMenuLevelList = params =>
    axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/getMenuLevelList`, {params});

//图解主目录分页查询
export const getGraphicinfo = params => axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicInfo`, { params });

//图解详情分页查询备件替换件信息
export const getSubPartList = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partinfo/getSubPartList`, {params});

//图解详情分页查询
export const getGraphicAssemblyList = params => axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/getGraphicAssemblyList`, {params});

//图解主表编辑
export const update = params => axios.post(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/update`,
  params
);

//图解子表编辑
export const updateGraphicAssembly = params => axios.post(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/updateGraphicAssembly`,
  params
);
// 批量导入
export const postImport = params => axios.post(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/importsUpgrade`, params)

//删除主表
export const deleteGraphicInfo = id => axios.post(`${SERVER.CMSCLOUD_EPC}/graphic/graphicInfo/deleteById/${id}` );

//删除子表
export const deleteGraphicAssembly = id => axios.post(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/deleteById/${id}` );

//查询备件图片
export const getFileGroup = params => axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/getfilelist`, { params });

// 删除上传总成图片
export const deleteZcPicFile = params => axios.post(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/deleteZcPicFile`,  params);

//图解物料分页查询
export const getgraphicAndAssemblyInfoPage = params => axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/selectgraphicAndAssemblyInfoPage`, { params });

//备件分页查询
export const getpartinfoPage = params => axios.get(`${SERVER.CMSCLOUD_EPC}/graphic/graphicAssemblyInfo/selectpartinfoPage`, { params });
